package org.dong.service.Impl;


import org.dong.mapper.OrderMapper;
import org.dong.pojo.Order;
import org.dong.service.OrderService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class OrderServiceImpl implements OrderService {

    @Resource
    OrderMapper orderMapper;

    @Override
    public Integer addOrder(Order order) {

        return orderMapper.addOrder(order);
    }

    @Override
    public List<Order> getOrderList(String sDate,String eDate,Integer userId,String sMeal,int page) {
        return orderMapper.getOrderList(sDate,eDate,userId,sMeal,page);
    }

    @Override
    public Integer getOrderListCount(String sDate, String eDate, Integer userId, String sMeal) {
        return orderMapper.getOrderListCount(sDate,eDate,userId,sMeal);
    }

    @Override
    public Integer updateOrder(Integer id, String codeUrl, Integer status) {

        return orderMapper.updateOrder(id, codeUrl, status);
    }

    @Override
    public Order getOrderInfo(Integer id,String orderSn) {
        return orderMapper.getOrderInfo(id,orderSn);
    }

    @Override
    public Integer updateOrderInfoContent(Integer id, Integer status, String content) {
        return orderMapper.updateOrderInfoContent(id, status, content);
    }
}
